﻿using System.Web.Mvc;

namespace Hasiu.Mvc.Infrastructure
{
    public class RedirectOfAddResult : ActionResult
    {
        private string Url { get; set; }

        public RedirectOfAddResult(string url)
        {
            Url = url;
        }

        public override void ExecuteResult(ControllerContext context)
        {
            context.HttpContext.Response.ContentType = "text/html";
            context.HttpContext.Response.Write("<script>alert('添加成功');location.href='" + Url + "';</script>");
            context.HttpContext.Response.End();
        }
    }
}
